From b693fe23115b4197c28df7e77bda54dc01c90242 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Fri, 10 Nov 2006 11:14:51 -0700 Subject: [PATCH] [IA64] fix VTI boot workaroud patch for memory initial interface Signed-off-by: zhang xiantao Signed-off-by: Zhang Xin --- tools/libxc/ia64/xc_ia64_hvm_build.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/libxc/ia64/xc_ia64_hvm_build.c b/tools/libxc/ia64/xc_ia64_hvm_build.c index ad5c6fdabd..a97b82af23 100644 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c @@ -554,14 +554,28 @@ setup_guest(int xc_handle, uint32_t dom, unsigned long memsize, unsigned long page_array[3]; shared_iopage_t *sp; void *ioreq_buffer_page; - unsigned long dom_memsize = (memsize << 20); + // memsize = required memsize(in configure file) + 16M + // dom_memsize will pass to xc_ia64_build_hob(), so must be subbed 16M + unsigned long dom_memsize = ((memsize - 16) << 20); + unsigned long nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT); + int rc; DECLARE_DOMCTL; + // ROM size for guest firmware, ioreq page and xenstore page + nr_pages += 3; + if ((image_size > 12 * MEM_M) || (image_size & (PAGE_SIZE - 1))) { PERROR("Guest firmware size is incorrect [%ld]?", image_size); return -1; } + rc = xc_domain_memory_increase_reservation(xc_handle, dom, nr_pages, + 0, 0, NULL); + if (rc != 0) { + PERROR("Could not allocate memory for HVM guest.\n"); + goto error_out; + } + /* This will creates the physmap. */ domctl.u.arch_setup.flags = XEN_DOMAINSETUP_hvm_guest; domctl.u.arch_setup.bp = 0; -- 2.30.2